package com.fita.entity.car;

import com.demo2do.core.utils.Alias;
import org.apache.commons.lang3.StringUtils;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("VehicleCategory")
public enum VehicleCategory {
    
    C1("1", "Car", "轿车", "C"),
    
    C2("2", "Van", "厢式面包车", "V"),
    
    C3("3", "SUV", "SUV", "F"),
    
    C4("4", "Convertible", "敞篷车", "T"),
    
    C5("5", "Truck", "卡车", "K"),
    
    C8("8", "Station Wagon", "旅行车", "W"),
    
    C11("11", "All Terrain", "吉普车", "J"),
    
    C12("12", "Recreational", "Recreational", "R"),

    C13("13", "Sport", "运动型轿车", "S"),
    
    C14("14", "Special", "Special", "X"),
    
    C15("15", "Extended cab pickup", "加长型皮卡", "Q"),
    
    C16("16", "Regular cab pickup", "皮卡", "P"),
    
    C17("17", "Special offer", "Special offer", "Z"),
    
    C18("18", "Coupe", "两门轿跑", "E"),
    
    C19("19", "Monospace", "Monospace", "M"),
    
    C20("20", "2wheel vehicle", "双轮车", "Y"),
    
    C21("21", "Roadster", "跑车", "N"),
    
    C22("22", "Crossover", "越界车", "G");
    
    private String code;
    
    private String englishName;
    
    private String chineseName;
    
    private String ssip;
    
    /**
     * 
     * @param code
     * @param english
     * @param chinese
     * @param ssip
     */
    private VehicleCategory(String code, String english, String chinese, String ssip) {
        this.code = code;
        this.englishName = english;
        this.chineseName = chinese;
        this.ssip = ssip;
    }
    
    /**
     * 
     * @param code
     * @return
     */
    public static  VehicleCategory codeOf(String code) {
        for(VehicleCategory category: VehicleCategory.values()) {
            if(StringUtils.equalsIgnoreCase(category.getCode(), code)) {
                return category;
            }
        }
        return null;
    }
    
    public String getChineseName() {
        return chineseName;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getEnglishName() {
        return englishName;
    }
    
    public String getSsip() {
        return ssip;
    }
}
